﻿@model InformaticaDiaryWeb.Models.CaseDetailsModel
@{
    ViewBag.Title = "Case Details";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<style type="text/css">
    .containerDiv {
        border: 1px solid #3697f6;
        width: 100%;
        display: table;
    }

    .rowDivHeader {
        border: 1px solid #668db6;
        background-color: #030D8D;
        color: white;
        color: #fff;
        font-weight: bold;
        display: table-row;
    }

    .rowDiv {
        border: 1px solid #333;
        background-color: #efeeef;
        display: table-row;
    }

    .cellDivHeader {
        border-right: 1px solid white;
        display: table-cell;
        width: 12%;
        padding: 1px;
        text-align: center;
    }

    .cellDiv {
        border-right: 2px solid white;
        display: table-cell;
        width: 10%;
        padding-right: 4px;
        text-align: center;
        border-bottom: none;
    }

    .lastCell {
        border-right: none;
    }
</style>
@using (Html.BeginForm())
{
    @Html.ValidationSummary()

   
    <table class="containerDiv">
        <tbody>
            <tr class="rowDivHeader">
                <td colspan="4" class="cellDivHeader lastCell">@Html.LabelFor(x => x.Fileno)</td>
            </tr>
            <tr class="rowDiv">
                <td colspan="4" class="cellDiv lastCell">@Html.DisplayFor(x => x.Fileno)</td>
            </tr>
            <tr class="rowDivHeader">
                <td class="cellDivHeader">@Html.LabelFor(x => x.CaseTypeName)</td>
                <td class="cellDivHeader">@Html.LabelFor(x => x.CaseNo)</td>
                <td class="cellDivHeader">@Html.LabelFor(x => x.CaseYear)</td>
                <td class="cellDivHeader lastCell">@Html.LabelFor(x => x.Stage)</td>
            </tr>
            <tr class="rowDiv">
                <td class="cellDiv">@Html.DisplayFor(x => x.CaseTypeName)</td>
                <td class="cellDiv">@Html.DisplayFor(x => x.CaseNo)</td>
                <td class="cellDiv">@Html.DisplayFor(x => x.CaseYear)</td>
                <td class="cellDiv lastCell">@Html.DisplayFor(x => x.Stage)</td>
            </tr>
            <tr class="rowDivHeader">
                <td class="cellDivHeader">@Html.LabelFor(x => x.CourtName)</td>
                <td class="cellDivHeader">@Html.LabelFor(x => x.CourtType)</td>
                <td colspan="2" class="cellDivHeader lastCell">@Html.LabelFor(x => x.PoliceStation)</td>
            </tr>
            <tr class="rowDiv">
                <td class="cellDiv">@Html.DisplayFor(x => x.CourtName)</td>
                <td class="cellDiv">@Html.DisplayFor(x => x.CourtType)</td>
                <td colspan="2" class="cellDiv lastCell">@Html.DisplayFor(x => x.PoliceStation)</td>
            </tr>
            <tr class="rowDivHeader">
                <td class="cellDivHeader">@Html.LabelFor(x => x.BackDate)</td>
                <td class="cellDivHeader">@Html.LabelFor(x => x.InstitutionDate)</td>
                <td colspan="2" class="cellDivHeader lastCell">@Html.LabelFor(x => x.NextDate)</td>
            </tr>
            <tr class="rowDiv">
                <td class="cellDiv">@Html.DisplayFor(x => x.BackDate)</td>
                <td class="cellDiv">@Html.DisplayFor(x => x.InstitutionDate)</td>
                <td colspan="2" class="cellDiv lastCell">@Html.DisplayFor(x => x.NextDate)</td>
            </tr>
            <tr class="rowDivHeader">
                <td colspan="2" class="cellDivHeader">@Html.LabelFor(x => x.Petitioner)</td>
                <td colspan="2" class="cellDivHeader lastCell">@Html.LabelFor(x => x.Respondant)</td>
            </tr>
            <tr class="rowDiv">
                <td colspan="2" class="cellDiv">@Html.DisplayFor(x => x.Petitioner)</td>
                <td colspan="2" class="cellDiv lastCell">@Html.DisplayFor(x => x.Respondant)</td>
            </tr>
            <tr class="rowDivHeader">
                <td colspan="2" class="cellDivHeader">@Html.LabelFor(x => x.PetitionerMob)</td>
                <td colspan="2" class="cellDivHeader lastCell">@Html.LabelFor(x => x.RespondantMob)</td>
            </tr>
            <tr class="rowDiv">
                <td colspan="2" class="cellDiv">@Html.DisplayFor(x => x.PetitionerMob)</td>
                <td colspan="2" class="cellDiv lastCell">@Html.DisplayFor(x => x.RespondantMob)</td>
            </tr>
            <tr class="rowDivHeader">
                <td colspan="2" class="cellDivHeader">@Html.LabelFor(x => x.PetitionerAdvocate)</td>
                <td colspan="2" class="cellDivHeader lastCell">@Html.LabelFor(x => x.RespondantAdvocate)</td>
            </tr>
            <tr class="rowDiv">
                <td colspan="2" class="cellDiv">@Html.DisplayFor(x => x.PetitionerAdvocate)</td>
                <td colspan="2" class="cellDiv lastCell">@Html.DisplayFor(x => x.RespondantAdvocate)</td>
            </tr>
            <tr class="rowDivHeader">
                <td colspan="2" class="cellDivHeader">@Html.LabelFor(x => x.PetitionerDetails)</td>
                <td colspan="2" class="cellDivHeader lastCell">@Html.LabelFor(x => x.RespondantDetails)</td>
            </tr>
            <tr class="rowDiv">
                <td colspan="2" class="cellDiv">@Html.DisplayFor(x => x.PetitionerDetails)</td>
                <td colspan="2" class="cellDiv lastCell">@Html.DisplayFor(x => x.RespondantDetails)</td>
            </tr>
            <tr class="rowDivHeader">
                <td colspan="4" class="cellDivHeader lastCell">@Html.LabelFor(x => x.PetitionerDetails)</td>
            </tr>
            <tr class="rowDiv">
                <td  colspan="4" class="cellDiv lastCell">
                    @if (Model.OrderJudgement.Length > 100)
                    {
                        <text>@Model.OrderJudgement.Substring(0, 100) ...</text>
                        <a href="#popupParis" data-transition="fade" data-rel="popup" data-position-to="window">More..</a>
                        <div id="popupParis" data-role="popup" data-theme="b" data-corners="true" data-overlay-theme="b">
                            <a class="ui-btn ui-corner-all ui-shadow ui-btn-a ui-icon-delete ui-btn-icon-notext ui-btn-right" href="#" data-rel="back">X</a>
                            @Html.DisplayFor(x => x.OrderJudgement)
                        </div>
                    }
                    else
                    {
                        @Html.DisplayFor(x => x.OrderJudgement)
                    }
                </td>
            </tr>
        </tbody>
    </table>  
  
}
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
    <script type="text/javascript">
        $(document).on("pagecreate", function () {
            $(".popupParis").on({
                popupbeforeposition: function () {
                    var maxHeight = $(window).height() - 60 + "px";
                    $(".popupParis").css("max-height", maxHeight);
                }
            });
        });
    </script>
}
